package com.sentinel;

import com.sentinel.datasource.SentinelDataSource;

import java.util.Iterator;
import java.util.ServiceLoader;

/**
 * 单独测试 jdk spi机制
 */
public class SentinelDataSourceTest {
    // 提供方运行的方法
    public static void main(String[] args) {

        ServiceLoader<SentinelDataSource> load
                = ServiceLoader.load(SentinelDataSource.class);
        Iterator<SentinelDataSource> iterator = load.iterator();
        while (iterator.hasNext()){
            SentinelDataSource dataSource = iterator.next();
            dataSource.loadRules("ok");
        }
    }
}
